home *** CD-ROM | disk | FTP | other *** search
- VERSION 2.00
- Begin Form CustForm
- BackColor = &H00C0C0C0&
- Caption = "Customer"
- ClientHeight = 2610
- ClientLeft = 3240
- ClientTop = 1830
- ClientWidth = 4635
- Height = 3015
- HelpContextID = 102
- Icon = CUST.FRX:0000
- Left = 3180
- LinkTopic = "Form2"
- MDIChild = -1 'True
- ScaleHeight = 2610
- ScaleWidth = 4635
- Top = 1485
- Width = 4755
- Begin TgDemo CustTable
- BackColor = &H00C0C0C0&
- BorderStyle = 0 'None
- Configurable = -1 'True
- DataSource = "Data1"
- Editable = -1 'True
- EditBackColor = &H8000000D&
- EditForeColor = &H8000000E&
- FetchMode = 0 'By cell
- FontBold = 0 'False
- FontItalic = 0 'False
- FontName = "MS Sans Serif"
- FontSize = 8.25
- FontStrikethru = 0 'False
- FontUnderline = 0 'False
- HeadBackColor = &H80000002&
- HeadForeColor = &H80000009&
- Headings = -1 'True
- Height = 1935
- HorzColor = &H00808080&
- HorzLines = 2 '3D
- InactiveBackColor= &H00808080&
- InactiveForeColor= &H00000000&
- Layout = CUST.FRX:0302
- Left = 0
- MarqueeStyle = 1 'Solid Cell Border
- SelectedBackColor= &H00000000&
- SelectedForeColor= &H00FFFFFF&
- SelectMode = 0 'Disabled
- TabIndex = 0
- Top = 0
- UseBookmarks = -1 'True
- VertColor = &H00808080&
- VertLines = 2 '3D
- Width = 3735
- End
- Begin Data Data1
- Caption = "Data1"
- Connect = ""
- DatabaseName = ""
- Exclusive = 0 'False
- Height = 270
- Left = 360
- Options = 0
- ReadOnly = 0 'False
- RecordSource = ""
- Top = 2040
- Visible = 0 'False
- Width = 1215
- End
- ' Local definitions for customer form
- Dim ourset As Dynaset
- Dim FormIndex As Integer
- Dim WidthDelta As Integer
- Sub CustTable_Append ()
- ' Append a new customer record. Add 1 to the last
- ' record and move to it.
- newcust& = 1000
- If ourset.RecordCount > 0 Then
- ourset.MoveLast
- newcust& = ourset("CustNo") + 1
- End If
- ourset.AddNew
- ourset("CustName") = "New..."
- ourset("CustNo") = newcust&
- ourset.Update
- ourset.MoveLast
- End Sub
- Sub CustTable_GotFocus ()
- ' Display status line help
- SetStatus "Customers - DownArrow for new; drag to order file to create orders"
- End Sub
- Sub CustTable_KeyPress (KeyAscii As Integer)
- ' Escape discards changes
- If KeyAscii = 27 Then Data1.UpdateControls
- End Sub
- Sub CustTable_KeyUp (KeyCode As Integer, Shift As Integer)
- ' F2 commits changes in the current record
- If KeyCode = KEY_F2 Then Data1.Recordset.Update
- End Sub
- Sub CustTable_LostFocus ()
- ' Update record data when switching to another form
- Data1.Recordset.Update
- End Sub
- Sub CustTable_MouseDown (Button As Integer, Shift As Integer, X As Single, Y As Single)
- GridMaybeDrag CustTable, X, Y
- End Sub
- Sub CustTable_MouseMove (Button As Integer, Shift As Integer, X As Single, Y As Single)
- GridTestDrag CustTable, Button, X, Y, MASK_CUST, Utils.DragRow
- End Sub
- Sub Form_Load ()
- ' Remember the difference between the inside and
- ' outside dimensions.
- WidthDelta = Me.Width - Me.ScaleWidth
- ' Capture information about the database we are opening.
- ' This information was prepared by the CustOpen routine
- ' in CUST.BAS
- FormIndex = FormLastAlloc()
- Me.Tag = FormIndex
- Data1.DatabaseName = CustFormItems(FormIndex).fiFileName
- Data1.RecordSource = CustFormItems(FormIndex).fiTable
- Data1.Refresh
- Set ourset = Data1.Recordset
- ' Our tag is used to notify drop destinations of
- ' which customer form instance we are.
- CustTable.Tag = FormIndex
- End Sub
- Sub Form_Resize ()
- ' The first time we resize (when we're opened),
- ' constrain our width. Thereafter, allow the width
- ' to be changed at the user's discretion.
- If WidthDelta Then
- If Me.WindowState = NORMAL Then
- Me.Width = CustTable.Width + WidthDelta
- CustTable.Height = Me.ScaleHeight
- WidthDelta = 0
- Exit Sub
- End If
- End If
- CustTable.Width = Me.ScaleWidth
- CustTable.Height = Me.ScaleHeight
- End Sub
- Sub Form_Unload (Cancel As Integer)
- ' Close the recordset and deallocate the form
- Data1.Recordset.Close
- FormFree CustFormItems(FormIndex)
- End Sub
-